﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OnlineShop
{
    public partial class AuthorizationForm : Form, ILogin
    {
        public event Action OkPressed;
        public event Action CancelPressed;

        public AuthorizationForm()
        {
            InitializeComponent();
            okBtn.Click += (sender, args) => Invoke(OkPressed);
            cnlBtn.Click += (sender, args) => Invoke(CancelPressed);

        }

        private void Invoke(Action action)
        {
            if (action != null) action();
        }

        public new void Show()
        {
            ShowDialog();
        }

        public void Message()
        {
            MessageBox.Show("wrong login or pass");
        }

        public string tbPass()
        {
            return passTB.Text;
        }

        public string tbLogin()
        {
            return loginTB.Text;
        }

    }
}
